import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CountingOrderInfoVO, CountingOrderInfoForm, CountingOrderInfoQuery } from '@/api/wms/fg/countingOrderInfo/types';

/**
 * 查询盘点单分页列表
 * @param query
 * @returns {*}
 */
export const pageCountingOrderInfo = (query?: CountingOrderInfoQuery): AxiosPromise<CountingOrderInfoVO[]> => {
  return request({
    url: '/wms/fg/countingOrderInfo/page',
    method: 'get',
    params: query
  });
};
/**
 * 查询盘点单列表
 * @param query
 * @returns {*}
 */
export const listCountingOrderInfo = (query?: CountingOrderInfoQuery): AxiosPromise<CountingOrderInfoVO[]> => {
  return request({
    url: '/wms/fg/countingOrderInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询盘点单详细
 * @param id
 */
export const getCountingOrderInfo = (id: string | number): AxiosPromise<CountingOrderInfoVO> => {
  return request({
    url: '/wms/fg/countingOrderInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增盘点单
 * @param data
 */
export const addCountingOrderInfo = (data: CountingOrderInfoForm) => {
  return request({
    url: '/wms/fg/countingOrderInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改盘点单
 * @param data
 */
export const updateCountingOrderInfo = (data: CountingOrderInfoForm) => {
  return request({
    url: '/wms/fg/countingOrderInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除盘点单
 * @param id
 */
export const delCountingOrderInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/wms/fg/countingOrderInfo/' + id,
    method: 'delete'
  });
};
